﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VietThuongLMS;
using VietThuongLMS.Utils;
namespace VietThuongLMS.Areas.Admin.Models
{
    public class LoaiLopHoc_GiaoVienModel
    {
        public int ID { get; set; }
        public int MaGiaoVien { get; set; }
        public int MaLoaiLopHoc { get; set; }
        public double Luong { get; set; }
        public string NgayBatDau { get; set; }
        public string NgayKetThuc { get; set; }
        public LoaiLopHoc_GiaoVienModel() {}
        public LoaiLopHoc_GiaoVienModel(LoaiLopHoc_GiaoVien llh_gv)
        {
            ID = llh_gv.ID;
            MaGiaoVien = (int)llh_gv.MaGiaoVien;
            MaLoaiLopHoc = (int)llh_gv.MaLoaiLopHoc;
            Luong = (double)llh_gv.Luong;
            NgayBatDau = llh_gv.NgayBatDau.Value.ToString("dd/MM/yyyy");
            NgayKetThuc = llh_gv.NgayKetThuc.Value.ToString("dd/MM/yyyy");
        }
        public LoaiLopHoc_GiaoVien ChuyenDoiModel()
        {
            Converter cter = new Converter();
            LoaiLopHoc_GiaoVien llh_gv = new LoaiLopHoc_GiaoVien();
            llh_gv.ID = ID;
            llh_gv.MaGiaoVien = MaGiaoVien;
            llh_gv.MaLoaiLopHoc = MaLoaiLopHoc;
            llh_gv.Luong = Luong;
            llh_gv.NgayBatDau = cter.StringToDate(NgayBatDau);
            llh_gv.NgayKetThuc = cter.StringToDate(NgayKetThuc);
            return llh_gv;
        }
    }
}